//
//  def_iteration_statement.h
//  compilation
//
//  Created by Kevin Le perf on 17/01/12.
//  Copyright (c) 2012 e2co technologie. All rights reserved.
//

#ifndef compilation_def_iteration_statement_h
#define compilation_def_iteration_statement_h

/*
 iteration_statement
 : WHILE '(' expression ')' statement {printf("iteration_statement\n");}
 ; 
 */

struct def_iteration_statement{
	void * parent;
	int type;
	struct def_expression * expression;
	struct def_statement * statement;
};

struct def_iteration_statement * iteration_statement_create(void * parent){
	struct def_iteration_statement * i = malloc(sizeof(*i));
	i->type = 0;
	i->parent = parent;
	return i;
}

void iteration_statement_print(struct def_iteration_statement * i){
	switch(i->type){
		case 1:
			printf("while(");
			expression_print(i->expression);
			printf(")");
			statement_print(i->statement);
	}
}
#endif
